import Ember from 'ember';
import Changeset from 'ember-changeset';
export default Ember.Controller.extend({
    statusService: Ember.inject.service("current-status"),
    queryCondition:'',
    mainController: Ember.inject.controller('business.mainpage'),
    addNewProject:false,
    name:'',

    projectCustomerList:Ember.computed('customerList',function(){
      let list = new Ember.A();
      let customerList = this.get('customerList');
      let projectList = this.get('projectList');
      if(customerList){
        customerList.forEach(function(customer){
          list.pushObject(customer);
        });
      }
      projectList.forEach(function(project){
        console.log("come in ?");
        list.forEach(function(customer){
          if(customer.get('id')==project.get('customer.id')){
            list.removeObject(customer);
          }
        });
      });
      return list;
    }),
    actions:{
      //跳转至编辑页
      toDetailPage(customer){
        let id=customer.get('id');
        this.get("mainController").switchMainPage('account-management-detail',{id:id});
      },
    },

});
